//定义全部接口返回数据都拥有ts类型
export interface ResponseData{
    code:number,
    message:string,
    ok: boolean,
    success: boolean
}

export interface R<T> extends ResponseData{
    data: T
}

export interface page<D> {
    records: D[],
    total: number,
    size: number,
    pages: number


}

/** 分页信息 */
export interface PageInfo {
    pageSize: number;
    pageIndex: number;
    orderBy?: string;
    orderDirection?: 'ASC' | 'DESC';
    groupBy?: string;
    offset?: number;
    needTotalCount?: boolean;
}
  
/** 通用分页请求（泛型） */
export interface PageQuery<T = Record<string, unknown>> {
    filterData?: T;
    pageInfo: PageInfo;
}
  
/** 空分页（可选） */
export const emptyPageInfo = (): PageInfo => ({
    pageSize: 10,
    pageIndex: 1,
    needTotalCount: true,
  });